package jp.co.apl.haven_enquete.android.db;

import jp.co.apl.haven_enquete.android.Cnst;
import jp.dev7.android.util.Dbs;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * DB操作オブジェクトを提供する.
 * 
 * @author narazaki.daishi
 */
public class DatabaseHelper extends SQLiteOpenHelper {

    public static final String DATABASE_FILENAME = "database.db";

    public DatabaseHelper(Context context) {
        super(context, DATABASE_FILENAME, null, Cnst.DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.d("haven", "onCreate called.");
        Dbs.createTable(db, "ANSWER", "BASIC_INFO");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int f, int t) {
        onCreate(db);
    }

}
